class Enums {
  constructor() {}
  // 状态 0=禁用 1=启用
  static status = [
    { label: '禁用', value: 0 },
    { label: '启用', value: 1 },
  ]
  // '企业类型 1.平台企业 2.供应商企业 3.客户企业',
  static companyType = [
    { label: '平台企业', value: 1 },
    { label: '供应商企业', value: 2 },
    { label: '客户企业', value: 3 },
  ]
  // taskType 1=卸货 2=装货 3=装卸货 4=维修 5=新造船
  static taskType = [
    { label: '卸货', value: 1 },
    { label: '装货', value: 2 },
    { label: '装卸货', value: 3 },
    { label: '维修', value: 4 },
    { label: '新造船', value: 5 },
  ]
  static async customerCompanyId(val) {
    try {
      const params = {
        companyType: 3,
        companyName: val,
      }
      const res = await $request.get('/api/common/company/query', { params })
      return (res || []).map((i) => ({ label: i.companyName, value: i.id }))
    } catch (error) {
      return []
    }
  }
  static async portId(val) {
    try {
      const res = await $request.get('/api/port/select', { params: { portName: val } })
      return (res || []).map((i) => ({ label: i.portName, value: i.id }))
    } catch (error) {
      return []
    }
  }
}

export default Enums
